# -*- coding: utf-8 -*-
"""
@Time    : 2024/7/13 14:44 
@Author  : ZhangShenao 
@File    : print_memory_usage.py 
@Desc    : 打印内存占用情况
"""

import os

import psutil


def print_memory_usage(hint: str) -> None:
    """
    打印内存占用情况
    :param hint: 打印提示
    """
    process = psutil.Process(os.getpid())
    memory_info = process.memory_info()
    memory_usage = memory_info.rss / 1024 / 1024  # MB
    print(f"[{hint}] memory usage: {memory_usage:.2f} MB")
